1. Field of the Invention
The present invention relates to a method, system, and program for prefetching data into cache.
2. Description of the Related Art
Data prefetching techniques are used to prefetch data from a non-volatile storage device, such as one or more hard disk drives, to a high speed memory, such as a volatile memory device referred to as a cache, in anticipation of future data requests. The data requests may then be serviced from the high speed cache instead of the storage device which takes longer to access. In this way, data may be returned to the requesting device faster.
During a sequential read operation, an application program, such as a batch program, will process numerous data records stored at contiguous locations in the storage device. It is desirable during such sequential read operations to prefetch the sequential data into cache in anticipation of the requests from the application program. Present techniques used to prefetch sequential blocks of data include sequential caching algorithms systems, such as those described in the commonly assigned patent entitled “CACHE DASD Sequential Staging and Method,” having U.S. Pat. No. 5,426,761. A sequential caching algorithm detects when a device is requesting data as part of a sequential access operation. Upon making such a detection, the storage controller will begin prefetching sequential data records following the last requested data record into cache in anticipation of future sequential accesses. The cached records may then be returned to the application performing the sequential data operations at speeds substantially faster than retrieving the records from a non-volatile storage device.
Another prefetching technique includes specifying a block of contiguous data records to prefetch into cache in anticipation of a sequential data request. For instance, the Small Computer System Interface (SCSI) provides a prefetch command, PRE-FETCH, that specifies a logical block address where the prefetching operation begins and a transfer length of contiguous logical blocks of data to transfer to cache. The SCSI PRE-FETCH command is described in the publication “Information Technology-SCSI Block Commands-2 (SBC-2)”, published by ANSI on Jan. 25, 2004, reference no. ISO/IEC 14776-322:200, Rev. 12, which publication is incorporated herein by reference in its entirety.
U.S. Pat. No. 6,449,697 describes a technique for prefetching non-contiguous blocks of data by submitting a data structure with the prefetch command specifying the non-contiguous data blocks to prefetch.